

#ifndef UD_IDGRAPH_H
#define UD_IDGRAPH_H 1

#include "zgraph.h"
#include "zdbidmap.h"

#pragma pack (push, 8)

class UcDbObjectIdGraphNode : public UcDbGraphNode
{
public:
    UcDbObjectIdGraphNode(const UcDbObjectId id);
    virtual ~UcDbObjectIdGraphNode();

    UcDbObjectId           id           () const;

private:

    UcDbObjectId        mId;
};

class UcDbObjectIdGraph : public UcDbGraph
{
public:
    UcDbObjectIdGraph();
    virtual ~UcDbObjectIdGraph();

    Ucad::ErrorStatus       addNode     (UcDbObjectIdGraphNode *);
    Ucad::ErrorStatus       delNode     (UcDbObjectIdGraphNode *);
    UcDbObjectIdGraphNode*  findNode    (const UcDbObjectId) const;
    UcDbObjectIdGraphNode*  idNode      (int idx) const;

private:
    UcDbIdMapping       mIdNodeMap;
};

inline UcDbObjectId UcDbObjectIdGraphNode::id() const
    {return mId; }

inline UcDbObjectIdGraphNode* UcDbObjectIdGraph::idNode(int idx) const
    { return (UcDbObjectIdGraphNode*)node(idx); }

#pragma pack (pop)

#endif

